package com.zxl.service.impl;


import com.zxl.annotations.ExecutorChoose;
import com.zxl.model.MetaDatabase;
import com.zxl.model.MetaTable;
import com.zxl.service.StatisticsService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;


@Slf4j
@Service
public class StatisticsServiceImpl implements StatisticsService {
    @Override
    @ExecutorChoose(value = "#databaseId", type = "database")
    public void checkHdfsFile(MetaTable metaTable, MetaDatabase metaDatabase, String databaseId, String createPerson) {
        System.out.println("开始统计");
        //1、先检查表是否正常接入数据，如果正在接入数据，此时不再去统计此表，防止overwrite方式写入数据的表统计结果不准
        //2、针对表id获取对应表id的锁，能获取到进行数据量统计
        //3、根据此表的hdfs文件路径查询所有分区数据文件路径，根据文件更新时间判断是否要重新统计数据
        System.out.println("统计完成");
    }
}
